package com.yanqu.road.server.channelserver.cmd.dispersegold;

import com.yanqu.road.pb.cross.disperseGold.CrossDisperseGoldProto;
import com.yanqu.road.server.channelserver.cmd.ChannelCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.channelserver.logic.ChannelMessageHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.ChannelProtocol;
import com.yanqu.road.server.protocol.Cross3Protocol;

@Cmd(code = ChannelProtocol.N_CHANNEL_DISPERSE_GOLD_RESULT_TRANSFER, desc = "跨地区送财结果转发")
public class ChannelDisperseGoldResultCmd extends ChannelCommand {

    private CrossDisperseGoldProto.CrossDisperseGoldInfoMsg reqMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = CrossDisperseGoldProto.CrossDisperseGoldInfoMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Cross3Protocol.C3_DISPERSE_GOLD_SEND_RESULT_FROM_CHANNEL, reqMsg);
        ChannelMessageHelper.sendToChannel(pbMsg, reqMsg.getChannelId());
    }

    @Override
    public void sendData() {

    }
}
